<?PHP

 require_once(dirname(__FILE__) . '/int.php');

 function doActive($page) {
  if (defined('PAGE') && PAGE == $page) {
   echo ' class="page_',  $page, ' active"';
  } else { echo ' class="page_', $page, '"'; }
 }

 function doSubActive($page) {
  if (defined('SUBPAGE') && SUBPAGE == $page) {
   echo ' class="active"';
  }
 }


 if (!defined('PREFIX')) { define('PREFIX', ''); }
?>
   <ul id="menu">
    <li<?PHP doActive('about'); ?>><a href="<?PHP echo PREFIX; ?>index"><?PHP echo t('menu_about'); ?></a></li>
    <li<?PHP doActive('releases'); ?>><a href="<?PHP echo PREFIX; ?>downloads"><?PHP echo t('menu_releases'); ?></a></li>
    <li<?PHP doActive('dev'); ?>><a href="<?PHP echo PREFIX; ?>development"><?PHP echo t('menu_development'); ?></a></li>
    <li<?PHP doActive('docs'); ?>><a href="<?PHP echo PREFIX; ?>documentation/contents"><?PHP echo t('menu_docs'); ?></a></li>
    <li<?PHP doActive('blog'); ?>><a href="http://blog.dmdirc.com/">Blog</a></li>
    <li<?PHP doActive('addons'); ?>><a href="http://addons.dmdirc.com/">Addons</a></li>
    <li<?PHP doActive('bugs'); ?>><a href="http://bugs.dmdirc.com/">Issues</a></li>
    <!-- <li<?PHP doActive('press'); ?>><a href="<?PHP echo PREFIX; ?>press"><?PHP echo t('menu_press'); ?></a></li> -->
   </ul>

<?PHP
 if (defined('PAGE') && file_exists(dirname(__FILE__) . '/' . PAGE . '.menu.php')) {
  require_once(dirname(__FILE__) . '/' . PAGE . '.menu.php');
 } else { echo '<ul id="submenu" class="page_', PAGE, '"><li>&nbsp;</li></ul>'; }

 if (!defined('NOINT')) {
?>

   <div id="languagemenu">
<?PHP
 foreach (getLanguages() as $lang) {
  // Pirate
  if ($lang == 'pr') { continue; }

  echo '<a href="'.getLanguageLink($lang).'"><img src="', PREFIX, 'res/flags/'.$lang.'.png"';
  echo ' alt="' . $lang . '"></a>';  
 }
?>
   </div>
<?PHP } ?>
